package com.aya.base.job;

import com.aya.base.job.config.JdbcConfig;
import com.aya.base.job.module.job.ScheduleCallback;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.PersistJobDataAfterExecution;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import javax.annotation.Resource;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class SpringBaseJob {
    private static final Logger logger = LoggerFactory.getLogger(SpringBaseJob.class);
    @Resource
    private JdbcConfig jdbcConfig;

    @Resource
    ApplicationContext applicationContext;

    @ScheduleCallback(name = "simpleSpringBaseJob")
    public void execute() {
        logger.info("SpringBaseJob 的单例 执行了");
    }

    @ScheduleCallback(name = "twoPhase")
    public void execXXX() {
        logger.info("第二阶段调度执行了");
    }
}
